﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Shop.Intermediate;

namespace Shop.Data.LinqToEntityProvider
{
    public class DbTransaction:ITransaction
    {
        private ShopObjectContext m_context;
        private System.Data.Common.DbTransaction m_tran;

        public DbTransaction(ShopObjectContext context)
        {
            this.m_context = context;
        }

        public void Begin()
        {
            this.m_tran = this.m_context.Connection.BeginTransaction();
        }

        public void Commit()
        {
            m_tran.Commit();
        }

        public void Rollback()
        {
            m_tran.Rollback();
        }
    }
}
